package com.gps.skyrc;

import com.clj.fastble.BleManager;
import com.gps.skyrc.bean.EventBusMessage;
import com.gps.skyrc.tool.EventBusUtils;
import com.gps.skyrc.tool.logger.ILogger;

import org.litepal.LitePal;
import org.litepal.LitePalApplication;

public class MyApplication extends LitePalApplication {

    @Override
    public void onCreate() {
        super.onCreate();
//        CrashReport.initCrashReport(getApplicationContext(), "d7b0da68e1", false);
        LitePal.initialize(this);
        BleManager.getInstance().init(this);
        BleManager.getInstance()//是否显示框架内部日志，重连次数和重连时间间隔，以及操作超时时间
                .enableLog(true)
                .setReConnectCount(1,5000)
                .setConnectOverTime(15000)
                .setOperateTimeout(5000);
    }


    @Override
    public void onTrimMemory(int level) {
        // 程序在内存清理的时候执行(测试退到后台都会执行)
        ILogger.e("onTrimMemory");
//        EventBusUtils.post(new EventBusMessage<>(SAVE_DATA));
        super.onTrimMemory(level);
    }
}
